import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from hyrobot.common import CHECK_POINT, STEP

from lib.webui import  *

class c73560:
    name = '验证登录文本框默认提示功能-73560' # 测试用例名字

# 初始化方法
    def setup(self):
        STEP(1, '打开网站')
        wd = open_browser()

    #清除方法
    def teardown(self):
        wd = get_global_webdriver()
        wd.quit()

    # 测试用例步骤
    def teststeps(self):
        # 获取webdriver对象 对应 已经登录好的浏览器
        driver = get_global_webdriver()
        # driver = webdriver.Firefox()
        driver.get("http://172.17.66.19:8080/")
        # time.sleep(2)
        STEP(2, "修改密码使用中文")
        expect_username_tips = "用户名"
        expect_password_tips = "密码"
        got_tips = driver.find_elements(By.CLASS_NAME,"el-input__inner")

        CHECK_POINT("提示信息是否一致", expect_username_tips == got_tips[0].get_attribute("placeholder")
                    and  expect_password_tips == got_tips[1].get_attribute("placeholder")
                    )
        driver.find_element(By.NAME, "username").send_keys("user4")
        driver.find_element(By.NAME, "password").send_keys("123456")
        driver.find_element(By.CSS_SELECTOR, ".el-button").click()
